import qButton from './button'
import CrudForm from './CrudForm'
import fileUpload from './UploadFile'
import imageUpload from './UploadImg'
import excelUpload from './UploadExcel'
import qTable from "./table/src/table"
// import unitSelect from './unitSelect'
import treeSelect from './treeSelect/src/treeSelect'
// import './fonts/font.scss'
// 存储组件列表
const components = [
  qButton,
  CrudForm,
  fileUpload,
  imageUpload,
  excelUpload,
  treeSelect,
  qTable
]
// 定义 install ⽅法，接收 Vue 作为参数。如果使⽤ use 注册插件，则所有的组件都将被
// 注册
const install = function (Vue) {
  // 遍历注册全局组件
  components.forEach(component => {
    Vue.component(component.name, component)
 })
}
// 判断是否是直接引⼊⽂件
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}
export default {
// 导出的对象必须具有 install，才能被 Vue.use() ⽅法安装
  install,
  qButton,
  CrudForm,
  fileUpload,
  imageUpload,
  excelUpload,
  treeSelect,
  qTable
}
